﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="clientesGrid.aspx.cs" Inherits="gridviews_clientesGrid" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
     <form id="form1" runat="server">
    <div>
    <script language='javascript'>
             
            function cancelar(){
                window.close();
            }
            
        </script>
    <table width="100%">
        <tr>
            <td align="center">
            <br />
            <br />
                <asp:Label ID="lb_buscar" runat="server" Text="Nombre: "></asp:Label>
                <asp:TextBox ID="txt_funcionario" runat="server"></asp:TextBox>
            </td>
        </tr>
        
        <tr>
           <td align="right">
               <asp:ImageButton ID="imgbt_buscar" runat="server" Height="58px" 
                   ImageUrl="~/images/buscar.png"  
                   ToolTip="buscar funcionario" onclick="imgbt_buscar_Click" />
               <asp:ImageButton ID="imgbt_cancelar" runat="server" Height="53px" 
                   ImageUrl="~/images/cancelar.jpeg" Width="61px" />
           </td>
        </tr>    
        <tr>
        
        <td align="center">
        
        <asp:GridView ID="GridClientes" runat="server" AutoGenerateColumns="False" 
            CellPadding="3" DataKeyNames="cod_cliente"
            ForeColor="Black" GridLines="Vertical" AllowPaging="True" 
                OnRowCommand="GridViewf_OnRowCommand" DataSourceID="SqlDataSource1" 
                BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" >
            <Columns>
                
                    <asp:BoundField DataField="cod_cliente" HeaderText="cod_cliente" 
                        ReadOnly="True" SortExpression="cod_cliente" />
                
                    <asp:BoundField DataField="nombre" HeaderText="nombre" 
                        SortExpression="nombre" />
                    <asp:BoundField DataField="apellido" HeaderText="apellido" 
                        SortExpression="apellido" />
                    <asp:BoundField DataField="direccion" HeaderText="direccion" 
                        SortExpression="direccion" />
                    <asp:BoundField DataField="CI" HeaderText="CI" 
                        SortExpression="CI" />
                    <asp:BoundField DataField="telefono" HeaderText="telefono" 
                        SortExpression="telefono" />
                    <asp:BoundField DataField="email" HeaderText="email" SortExpression="email" />
                    <asp:TemplateField>
                     <ItemTemplate>
                      <asp:ImageButton ID="ImageButton1" runat="server" CommandName="Aceptar" ImageUrl="~/images/seleccionar.png" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>"
                         />
                         </ItemTemplate>
                       </asp:TemplateField>
            </Columns>
            <FooterStyle BackColor="#CCCCCC" />
            <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
            <AlternatingRowStyle BackColor="#CCCCCC" />
        </asp:GridView>
            
            
            
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ventas.mdf;Integrated Security=True;User Instance=True" 
                ProviderName="System.Data.SqlClient" 
                
                SelectCommand="SELECT c.cod_cliente, p.nombre, p.apellido, p.direccion, p.CI, p.telefono, p.email FROM cliente AS c INNER JOIN persona AS p ON c.cod_persona = p.cod_persona">
      
            </asp:SqlDataSource>
            
            
            
    </td>
        </tr>
    </table>
    </div>
    </form>
</body>
</html>
